/**
 * Created by Sean Patrick Floyd (<a
 * href="mailto:sean@mostlymagic.com">sean@mostlymagic.com</a>) on 20.05.2010.
 */
package com.google.code.imds4j.impl.map;

import java.util.Collection;
import java.util.HashSet;

import com.google.code.imds4j.api.Query;

class OrQuery<V> implements Query<V> {

    private final Query<V> first;
    private final Query<V> second;

    public OrQuery(final Query<V> first, final Query<V> second) {
        this.first = first;
        this.second = second;
    }

    @Override
    public Collection<V> get() {
        final Collection<V> result = new HashSet<V>(this.first.get());
        result.addAll(this.second.get());
        return result;
    }

}